package com.yict.csms.resourceplan.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.yict.csms.system.entity.DataDict;

/**
 * 
 * @author Patrick.Deng
 * 
 */
@Entity
@Table(name = "CSMS_RTGC_FL_PLAN_ALL")
public class RtgcFlPlanAll {

	@Id
	@Column(name = "ALLID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "csms_rtgc_fl_planAll_seq")
	@SequenceGenerator(name = "csms_rtgc_fl_planAll_seq", sequenceName = "SEQ_CSMS_RTGC_FL_PLANALL", allocationSize = 1, initialValue = 1)
	private Long allId;

	@ManyToOne
	@JoinColumn(name = "TIMEID")
	private RtgcFlTime rtgcFlTime;

	@Column(name = "PLANDATE")
	private Date planDate;

	@ManyToOne
	@JoinColumn(name = "PLANTIME")
	private DataDict planTime;

	@ManyToOne
	@JoinColumn(name = "MACHINE")
	private DataDict machine;

	@Column(name = "ALLQUANHOURS")
	private Long allQuanHours;

	@ManyToOne
	@JoinColumn(name = "STATUS")
	private DataDict status;

	@Column(name = "CREATEPERSON")
	private Long createperson;

	@Column(name = "CREATEDATE")
	private Date createdate;

	@Column(name = "UPDATEPERSON")
	private Long updateperson;

	@Column(name = "UPDATEDATE")
	private Date updatedate;

	@OneToMany(mappedBy="rtgcFlPlanAll")
	@JoinColumn(name = "ALLID")
	@OrderBy("operatTime ASC,tMode ASC")
	public Set<RtgcFlPlan> rtgcFlPlanSet;

	@OneToMany(mappedBy="rtgcFlPlanAll")
	@JoinColumn(name = "ALLID")
	@OrderBy("company ASC,rfcId ASC")
	public Set<RtgcFlContractor> rtgcFlContractorSet;

	public Long getAllId() {
		return allId;
	}

	public void setAllId(Long allId) {
		this.allId = allId;
	}

	public RtgcFlTime getRtgcFlTime() {
		return rtgcFlTime;
	}

	public void setRtgcFlTime(RtgcFlTime rtgcFlTime) {
		this.rtgcFlTime = rtgcFlTime;
	}

	public Date getPlanDate() {
		return planDate;
	}

	public void setPlanDate(Date planDate) {
		this.planDate = planDate;
	}

	public DataDict getPlanTime() {
		return planTime;
	}

	public void setPlanTime(DataDict planTime) {
		this.planTime = planTime;
	}

	public DataDict getMachine() {
		return machine;
	}

	public void setMachine(DataDict machine) {
		this.machine = machine;
	}

	public Long getAllQuanHours() {
		return allQuanHours;
	}

	public void setAllQuanHours(Long allQuanHours) {
		this.allQuanHours = allQuanHours;
	}

	public DataDict getStatus() {
		return status;
	}

	public void setStatus(DataDict status) {
		this.status = status;
	}

	public Long getCreateperson() {
		return createperson;
	}

	public void setCreateperson(Long createperson) {
		this.createperson = createperson;
	}

	public Date getCreatedate() {
		return createdate;
	}

	public void setCreatedate(Date createdate) {
		this.createdate = createdate;
	}

	public Long getUpdateperson() {
		return updateperson;
	}

	public void setUpdateperson(Long updateperson) {
		this.updateperson = updateperson;
	}

	public Date getUpdatedate() {
		return updatedate;
	}

	public void setUpdatedate(Date updatedate) {
		this.updatedate = updatedate;
	}

	public Set<RtgcFlPlan> getRtgcFlPlanSet() {
		return rtgcFlPlanSet;
	}

	public void setRtgcFlPlanSet(Set<RtgcFlPlan> rtgcFlPlanSet) {
		this.rtgcFlPlanSet = rtgcFlPlanSet;
	}

	public Set<RtgcFlContractor> getRtgcFlContractorSet() {
		return rtgcFlContractorSet;
	}

	public void setRtgcFlContractorSet(Set<RtgcFlContractor> rtgcFlContractorSet) {
		this.rtgcFlContractorSet = rtgcFlContractorSet;
	}
}
